#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int a, b, i, sum1, sum2;;
	while (cin >> a >> b)
	{
		sum1 = sum2 = 0;
		if (a > b) { i = a; a = b; b = i; }
		for (i = a; i <= b; i++)
		{
			if (i % 2)sum2 += i*i*i;
			else sum1 += i*i;
		}
		cout << sum1 << " " << sum2 << endl;
	}
	return 0;
}